<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        canvas {
            width: 500px;
            height: 300px;
        }
    </style>
</head>

<body>
    <canvas></canvas>
    <script>
        var canvas = document.querySelector("canvas");

        // 获取一个绘画环境对象
        var can = canvas.getContext("2d");
        can.scale(1, 0.5);
        can.lineTo(10, 10);
        can.lineTo(100, 10);
        can.strokeStyle = "red"; // 描边颜色
        can.lineWidth = '2px';
        can.stroke(); // 描边


       // can.lineTo



    </script>
</body>

</html>